package com.koron.css2.workflow;

import com.koron.css2.ApplicationConfig;
import com.koron.css2.ServerInterface;
import com.koron.css2.serviceManage.bean.RequestBean;
import com.koron.css2.serviceManage.bean.UserInfoBean;
import com.koron.util.Constant;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

/**
 * @author 工作流平台url获取
 * cd
 */
public class ProcessUrl implements ServerInterface {
    private static Logger log = LogManager.getLogger(ProcessPlatformSSO.class);

    @Override
    public MessageBean<?> exec(SessionFactory factory, UserInfoBean userInfo, RequestBean req) {
        MessageBean<String> info = MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "success", String.class);
        try {

            String url = ApplicationConfig.getWorkflowUrl();
            info.setData(url);
        } catch (Exception e) {
            info.setCode(Constant.MESSAGE_INT_FAIL);
            info.setDescription(e.getMessage());
            log.error("工作流平台url获取错误:" + e.getMessage(), e);
        }
        return info;
    }
}